Skip to content

Reimplement REST interface using HTTP/2 #371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

frankosterfeld
Copy link
Contributor

@frankosterfeld frankosterfeld commented Apr 24, 2025

Implements a new REST interface using HTTP/2, for lower latency and multiplexing of multiple requests on a single connection.
Instead of multithreading + blocking I/O, where each (long-poll) client occupies a thread, using event-driven non-blocking I/O, and poll() the HTTP-related sockets (server socket and client connections) together with the ZMQ sockets. For that, integrate the server more closely with the Broker.

The HTTP/3 implementation has been tested manually using Chrome and curl (see README) but is not covered by unit tests yet, as the native HTTP/3 client implementation would be considerable effort (and probably some more kloc's of code...). As agreed upon with @RalphSteinhagen , the native client might be done later possibly with other libraries like libcurl/CPR that require less code than ngtcp2, given that the client side is not the performance-critical part.

@frankosterfeld frankosterfeld changed the title Frank/http2 Reimplement REST interface using HTTP/2 Apr 24, 2025
@wirew0rm wirew0rm linked an issue Apr 24, 2025 that may be closed by this pull request
@frankosterfeld frankosterfeld temporarily deployed to configure coverage June 4, 2025 14:03 — with GitHub Actions Inactive
@frankosterfeld frankosterfeld temporarily deployed to configure coverage June 4, 2025 14:03 — with GitHub Actions Inactive
@frankosterfeld frankosterfeld temporarily deployed to configure coverage June 4, 2025 14:03 — with GitHub Actions Inactive
@frankosterfeld frankosterfeld temporarily deployed to configure coverage June 4, 2025 14:03 — with GitHub Actions Inactive
@frankosterfeld frankosterfeld temporarily deployed to configure coverage June 4, 2025 14:07 — with GitHub Actions Inactive
@frankosterfeld frankosterfeld temporarily deployed to configure coverage June 4, 2025 14:07 — with GitHub Actions Inactive
@frankosterfeld frankosterfeld temporarily deployed to configure coverage June 4, 2025 14:07 — with GitHub Actions Inactive
@frankosterfeld frankosterfeld temporarily deployed to configure coverage June 4, 2025 14:07 — with GitHub Actions Inactive
@frankosterfeld frankosterfeld temporarily deployed to configure coverage June 4, 2025 14:07 — with GitHub Actions Inactive
@frankosterfeld frankosterfeld temporarily deployed to configure coverage June 4, 2025 14:07 — with GitHub Actions Inactive
@frankosterfeld frankosterfeld temporarily deployed to configure coverage June 4, 2025 15:36 — with GitHub Actions Inactive
@frankosterfeld frankosterfeld temporarily deployed to configure coverage June 4, 2025 15:36 — with GitHub Actions Inactive
@frankosterfeld frankosterfeld temporarily deployed to configure coverage June 4, 2025 15:36 — with GitHub Actions Inactive
@frankosterfeld frankosterfeld temporarily deployed to configure coverage June 4, 2025 15:36 — with GitHub Actions Inactive
@frankosterfeld frankosterfeld temporarily deployed to configure coverage June 4, 2025 15:36 — with GitHub Actions Inactive
@frankosterfeld frankosterfeld temporarily deployed to configure coverage June 4, 2025 15:36 — with GitHub Actions Inactive
Implements HTTP/3 support in the server, following the implementation
in ngtcp2's server.cc example. A lot of the function logic and structure
from there has been preserved for easier debugging and comparing to the
example if needed.

Signed-off-by: Frank Osterfeld <[email protected]>
Use CRTP to prepare for a Http3ClientSession (not implemented yet).

Signed-off-by: Frank Osterfeld <[email protected]>
Copy link

codecov bot commented Jun 5, 2025

Codecov Report

Attention: Patch coverage is 35.44495% with 856 lines in your changes missing coverage. Please review.

Project coverage is 48.29%. Comparing base (750cd50) to head (f5faf94).

Files with missing lines Patch % Lines
src/client/include/RestClientNative.hpp 43.70% 71 Missing and 184 partials ⚠️
src/majordomo/include/majordomo/NgTcp2Util.hpp 7.44% 165 Missing and 9 partials ⚠️
src/rest/include/rest/RestUtils.hpp 51.60% 70 Missing and 51 partials ⚠️
...ordomo/include/majordomo/TlsServerSession_Ossl.hpp 6.97% 117 Missing and 3 partials ⚠️
src/majordomo/include/majordomo/Rest.hpp 39.55% 34 Missing and 47 partials ⚠️
src/majordomo/include/majordomo/Broker.hpp 35.86% 23 Missing and 36 partials ⚠️
src/services/include/services/dns.hpp 19.04% 2 Missing and 15 partials ⚠️
src/majordomo/include/majordomo/LoadTestWorker.hpp 62.16% 2 Missing and 12 partials ⚠️
...ajordomo/include/majordomo/TlsSessionBase_Ossl.hpp 0.00% 13 Missing ⚠️
src/core/include/Topic.hpp 33.33% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #371      +/-   ##
==========================================
- Coverage   56.84%   48.29%   -8.55%     
==========================================
  Files          72       78       +6     
  Lines        7561     9793    +2232     
  Branches     2838     3693     +855     
==========================================
+ Hits         4298     4730     +432     
- Misses       1335     2848    +1513     
- Partials     1928     2215     +287     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

sonarqubecloud bot commented Jun 5, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
36 Security Hotspots
32.4% Coverage on New Code (required ≥ 80%)
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@frankosterfeld frankosterfeld deployed to configure coverage June 5, 2025 13:33 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[10SP] OpenCMW: Rework REST/ZeroMQ interface
1 participant